all: gencode.cmo cparser.cmo clexer.cmo cio.cmo

# Compilation of .ml files

gencode.ml: Gencode.thy
	isabelle tty < Gencode.thy

clexer.ml: clexer.mll gencode.cmo
	ocamllex $<

cparser.ml cparser.mli: cparser.mly gencode.cmo
	ocamlyacc -v $<

gencode.cmo: gencode.ml
	ocamlc -c nums.cma $<

clexer.cmo: clexer.ml cparser.cmo gencode.cmo
	ocamlc -c $<

cparser.mli: cparser.ml gencode.cmo
	ocamlc -i canparser.ml > canparser.mli

cparser.cmo: cparser.ml cparser.cmi gencode.cmo
	ocamlc -c $<

cio.cmo: cio.ml
	ocamlc -c $<

#### Generic rules

%.cmi: %.mli
	ocamlc -c $<

.PHONY: clean

clean: 
	rm clexer.ml cparser.ml cparser.output gencode.ml *.mli *.cmi *.cmo
 